Re: Speeding up LIKE with placeholders? - Mailing list pgsql-general

From Dan Sugalski
Subject Re: Speeding up LIKE with placeholders?
Date
Msg-id a06110400bd68f8fd22da@[10.0.1.5]
Whole thread Raw
In response to Re: Speeding up LIKE with placeholders?  (Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>)
List pgsql-general
At 12:30 PM +0200 9/11/04, Pierre-Frédéric Caillaud wrote:
>    If I understand correctly your problem is
>that the plan for your prepared query is bad
>because the LIKE parameter is not known at
>prepare time...

Almost. My problem is that queries made with the
PQexecParams C call are automatically split into
a prepare and execute pair. So while as far as my
code's concerned everything goes over to the
server in one big wad, the same as if I'd sent it
over with a PQexec call, the server sees it in
several pieces.

The only way to fix this is to change the way
that PQexecParams is handled, which from what I
can see of the postgres code would require a
protocol change and corresponding extension of
the server back end, or a change in the way
prepared queries are executed by the server,
neither of which is a particularly simple thing
to do. (Which I didn't realize initially)
--
                Dan

--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Obtaining the Julian Day from a date
Next
From: "Karl O. Pinc"
Date:
Subject: Re: Obtaining the Julian Day from a date